package cn.wolfcode.rbac.mapper;

import cn.wolfcode.rbac.domain.Employee;
import cn.wolfcode.rbac.domain.Role;
import cn.wolfcode.rbac.qo.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {

    // 增
    int save(Employee employee);

    // 删
    int delete(Long id);

    // 改
    int update(Employee employee);

    // 查

    Employee get(Long id);

    List<Employee> listAll();

    // 分页 和 查询
    int selectForCount(QueryObject qo);

    List<Employee> selectForList(QueryObject qo);

    void deleteByEmployeeId(@Param("id") Long id);

    void insertRelation(@Param("roleId") Long roleId, @Param("employeeId") Long employeeId);

    List<Role> queryByEmployeeId(@Param("id") Long id);

    Employee login(String username, String password);
}